import React, { memo,useEffect } from "react";
import { useDispatch } from "react-redux";

import "./index.scss";
import albumAction from "store/action/albums";

import WYHotAlbum from "./c-cpns/hot-album";
import HYTopAlbum from "./c-cpns/top-album";

const WYAlbum = memo(function () {
  const dispatch = useDispatch();

  useEffect(() => {
    dispatch(albumAction.getHotAlbums());
    dispatch(albumAction.getTopAlbums());
  }, [dispatch]);

  return (
    <div className="wy-album wrap-v2">
      <WYHotAlbum />
      <HYTopAlbum />
    </div>
  );
});

export default WYAlbum;
